-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hybrid shuffle #1387
base: main
Are you sure you want to change the base?
Hybrid shuffle #1387
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1387 +/- ##
==========================================
+ Coverage 93.70% 93.73% +0.03%
==========================================
Files 223 224 +1
Lines 37561 37672 +111
==========================================
+ Hits 35195 35313 +118
+ Misses 2366 2359 -7 ☔ View full report in Codecov by Sentry. |
|
||
/// Converts `IndistinguishableHybridReport` into | ||
/// an `AdditiveShare` needed for shuffle protocol. | ||
pub fn hybrid_report_to_shuffle_input<YS, BK, V>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would it make more sense to implement these as From
traits.
Right now, ctx.shuffle
has the trait bound
I: IntoIterator<Item = AdditiveShare<S>> + Send,
but you could also consider updating that so that Item
implements conversion into AdditiveShare<S>
, rather than being an AdditiveShare
directly.
Updating this now will either mean updating existing IPA to work the same way (yuck!), so maybe we wait for now.
.into_iter() | ||
.map(|item| shuffled_to_hybrid_report(&item)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: iter().map(shuffled_to_hybrid_report)
.into_iter() | ||
.map(|item| hybrid_report_to_shuffle_input::<BA112, BK, V>(&item)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Don't think you need the owning iterator. See comment bellow.
|
||
/// Converts an `AdditiveShare` obtained from shuffle protocol | ||
/// into an `IndistinguishableHybridReport`. | ||
pub fn shuffled_to_hybrid_report<YS, BK, V>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these go away with the new sharded shuffle and its Shufflable
trait?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, they do.
let world = TestWorld::default(); | ||
|
||
let mut rng = rand::thread_rng(); | ||
let mut records = Vec::new(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Can you do something like?
let records = (0..BATCHSIZE).map(|_| TestIndistinguishableHybridReport{ ... })
I don't think we should use the old shuffle as it is not sharded and it won't be possible to make it sharded. Instead, we should take the sharded implementation for Hybrid (protocol/prf/shuffle/sharded.rs) |
mmm, I didn't mean to close it, it was a misclick |
This implements the plumbing required to shuffle
IndistinguishableHybridReports
and adds the shuffle step to the protocol.As we discussed earlier, we may need to add the right Sharded + Malicious trait which will then make the
ctx
used here have the sharded + malicious shuffle.